<template>
  <div class="row">
    <div class="container-fluid">
      <div class="row border" v-for="(v, i) in num" :key="'1triangular'+i">
        <div class="container-fluid  left-1">
          <div class="row flexwrap" v-for="vo in i+1" :key="`${vo+2}${i}triangularvo`">
            <div
              class="rounded-circle w-35"
              v-for="voi in num[vo-1]"
              :key="`${voi+2}triang${i}ularvo`"
            ></div>
          </div>
        </div>
        <div class="right-1" v-text="`${v*(v+1)/2}`">
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { Component, Vue, Watch, Provide, Prop } from "vue-property-decorator";

@Component({
  name: "triangular"
})
export default class Add extends Vue {
  @Prop() private num!: number[];

  mounted(): void {}
}
</script>

<style lang="scss" scoped>
.w-35 {
  width: 2.3rem;
  height: 2.3rem;
  background-color: chartreuse;
  border: 1px solid #000000;
  margin: 2px;
  display: inline-block;
}
.flexwrap {
  flex-wrap: wrap;
  align-items: center;
}
.left-1 {
  flex: 1;
}
.right-1 {
  width: 65px;
  text-align: center;
  border-left: 2px solid #eeeeee; 
}
</style>
